﻿using System;
using Microsoft.Owin;
using Owin;
using Microsoft.Owin.Security.OAuth;
using System.Web.Http;

[assembly: OwinStartup(typeof(SIG.Web.Startup))]
//[assembly: log4net.Config.XmlConfigurator(ConfigFile = "Web.config", Watch = true)]
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
namespace SIG.Web
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            HttpConfiguration config = new HttpConfiguration();

            ConfigureOAuth(app);

            WebApiConfig.Register(config);
            app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);
            app.UseWebApi(config);

           
            
        }
        public void ConfigureOAuth(IAppBuilder app)
        {

            //OAuthAuthorizationServerOptions OAuthServerOptions = new OAuthAuthorizationServerOptions()
            //{

            //    AllowInsecureHttp = true,
            //    TokenEndpointPath = new PathString("/authtoken"),
            //    AccessTokenExpireTimeSpan = TimeSpan.FromDays(1),
            //    //  AllowInsecureHttp = false, //HTTPS is allowed only
            //   // RefreshTokenProvider = new RefreshTokenProvider(),
            //    Provider = new SimpleAuthorizationServerProvider()
            //};

            //// Token Generation
            //app.UseOAuthAuthorizationServer(OAuthServerOptions);

            //app.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions());

        }

    }
}
